Custom Tool Headers not saving
# support
t
I'm trying to save the custom tool headers and the server URL secret token so I can pass an API key into our systems. I've tried a million different ways to get this to save, but it just won't do it. No matter what I do, I can't get them to save on a custom tool. Here's an example of a tool; I just can't get the headers to save at all. The tool is calling from the assistant, but it's not sending the API key, so I'm stuck.
Copy code
9c1fa660-32d3-439b-b2f7-1e36e7161150
v
@The Reverend I understand that you're having trouble saving custom tool headers and the server URL secret token to pass an API key into your systems. To assist you better, I would need to know the specific steps you're taking to save these settings in the VAPI interface. However, if you're trying to set a secret that VAPI will send with every request to your server, you should use the
assistant.model.tools.server.secret
parameter to set your API key. This secret will be sent as a header called
x-vapi-secret
. Here's a general guide on how you can set this up: 1. Access the VAPI interface where you configure your tools. 2. Locate the section where you can set the server secret. 3. Enter your API key as the value for the
assistant.model.tools.server.secret
. 4. Save your configuration. If you've already done this and it's not working, please ensure that the tool you're using is correctly configured to include headers when making requests. If the tool is a custom tool, you might need to review its documentation or configuration settings to ensure it's capable of including headers. If you continue to face issues, please ask support for more info on this, as they can provide more detailed assistance and troubleshooting specific to your setup.
You can continue this conversation by mentioning me in the message.
s
@The Reverend Would you be able to record a Loom video demonstrating the issue of headers not saving from the dashboard? This will allow me to review the situation. In the meantime, to facilitate your progress, you may utilize the API to add the headers as outlined in the following documentation: https://docs.vapi.ai/api-reference/tools/create. I would appreciate hearing your thoughts on this matter.
t
Yes for sure! Here's what I'm seeing. https://www.loom.com/share/68962080e9dc4246bca6615f2e1478f3?sid=3aa5886a-1f55-407c-ab66-57a0c2c3f3a0 It's repeatable. I've logged in, logged out, and tried different browser sessions, but it never saves.
s
@The Reverend I have generated the ticket for this matter, and I will inform you once it has been resolved. In the meantime, you may utilize the API POST or PATCH methods to add headers to the tool.
t
Ok thank you! 🙏
m
This issue reproduces 100%.
z
Hey @Shubham Bajaj I'm experiencing a related issue where I set Server URL Secret in the dashboard in my Assistant -> Advanced -> Messaging section and it saves for a short time but when I come back a few minutes later it's unset. Any updates on this bug?
s
The assistant server url is working can you share the loom video please.
a
this is marked as solved, but it's still a live issue
s
@Andrew This will be resolved in dashboard_V2, untill then can you use API for adding/updating headers with the tool.
d
@Shubham Bajaj The issue seems to appear in the api as well, consider;
Copy code
curl --location --request PATCH 'https://api.vapi.ai/tool/{toolId}' \
--header 'Authorization: Bearer {token}' \
--header 'Content-Type: application/json' \
--data '{
  "function": {
    ...
  },
  "server": {
    "url": "https://URL",
    "timeoutSeconds": 30,
    "headers": {
        "x-api-key": "my-api-key-here"
    }
  },
  "async": true
}'
The API response indicates that the headers were accepted, the header also appears in the corresponding GET request on the same tool, however the downstream call does not attach the header to the request
k
Hey Matt, can you send the complete CURL request in DM?
s
@Doxy can you share the call ID please?
d
@Shubham Bajaj call_SzN0MxDW63LcEXoLqnj7gJPQ
k
Hey Matt, sorry this is not the correct call_id. You can find it in call logs section.
d
In the payload sent. I have validated that the configuration of the tool contained in the JSON payload includes the x-api-key header, however the headers of the incoming request did not include the header
The call_id is 29f022ee-860b-40d7-b1bc-ce289a935f11
This is in the body of the request, are you saying that i shouldn't expect the headers to appear in the actual outgoing header?
Also in future, can we discuss this in private
s
Sure, can you show me how does the request looks like in your end.
look at the end, there is a header property
d
I have sent you a PM with a link to the webhook test site showing the full body of the received request
On the right hand side you can see an empty x-vapi-secret was used (which is expected as one isn't set) however the defined headers aren't present
I did check what you've sent but this shows the config of the tool, not what was observed
k
Can you use NGROK and me the HTTP Headers? It might be that it is hidden by [webhook.site](http://webhook.site)
n
I am having the same issue when trying to save it on the webapp ui. It will not save when I go back to the tool
k
You will need to use API for it.
c
Was this issue solved I used the API it comes in header but it never vaildates
I am facing he same issue I add the authorization header with value as I also tried x-vapi-secret It doesn't work Here is the command i am using but I still keep getting 401 error
Copy code
curl -X PATCH https://api.vapi.ai/tool/toolcallId \
-H "Authorization: Bearer vapiapikey" \
-H "Content-Type: application/json" \
-d '{
  "function": {
    "name": "toolcallname",
    "description": "some description",
    "parameters": {
      "type": "object",
      "properties": {}
    }
  },
  "server": {
    "url": "webhookurl",
    "timeoutSeconds": 30,
    "headers": {
      "x-vapi-secret": "Bearer API_KEY"
    }
  },
  "async": false
}'
t
Yeah still not working for me either even via api to set the headers.
k
Hey Matt, can you share the error response your getting and your ORG_ID?
f
Hi! same issue on my side. Headers are not saved
k
Hey @MattTrainer, sorry for the delay. Can you please share the curl request which your using to create tool headers or calll ID so I can take a look?
14 Views